<?php

/**
 * Created by PhpStorm.
 * User: luanpeng
 * Date: 2017/2/7
 * Time: 18:25
 */
namespace app\index\validate;

class UserBase extends Base
{
    protected $rule =   [
        'fieldList'=>'noOrJsonArray',
        'addr'=>'require',
        'default'=>'require|in:0,1',
        'regionId'=>'require|number',
        'keyValueJson'=>'require|JsonObj',
        'idList'=>'require|JsonArray'
    ];

    protected $message  =   [
        'fieldList.noOrJsonArray' => '筛选字段不填或必须为json数组',
        'addr.require' => '详细地址信息必填',
        'default.require' =>'默认地址信息必填',
        'default.in'=>'默认地址出错',
        'regionId.require' =>'地区信息必填',
        'regionId.number'=>'地区编号必须是数字',
        'keyValueJson.require'=>'传入参数必须存在',
        'keyValueJson.JsonObj'=>'传入参数必须是json对象',
        'idList.require'=>'编号信息必传',
        'idList.JsonArray'=>'传入编号信息必须是json数组',
    ];

    protected $scene = [
        'getInfo' => ['fieldList'],
        'addressMif'=>['addr','default','regionId'],
        'update' =>['keyValueJson'],
        'delAddr'=>['idList']
    ];

}